﻿<%@ Control Language="C#" ClassName="ProductDetailControl" %>
<%@ Register TagPrefix="Page" TagName="SiteMap" Src="~/UserControls/SiteMapControl.ascx" %>

<%@ Import Namespace="System.Web.Script.Serialization" %>

<script runat="server">

  public HtmlImage ImgBanner { get; set; }
  public string IsDialog { get; set; }

  private JObject restoredObject;
  protected void Page_Load(object sender, EventArgs e)
  {
    if (!Page.IsPostBack)
    {
      string B2C_CODE = Request.QueryString["B2C_CODE"];
      B2C_MALL_HOME ws = new B2C_MALL_HOME();
      ws.Url = ConfigurationManager.AppSettings["B2C_MALL_HOME"].ToString();
      string jsonString =
        ws.B2C_MALL_GetProductDetail(ConfigurationManager.AppSettings["WebDeviceid"].ToString()
        , HttpContext.Current.User.Identity.Name, B2C_CODE);
      restoredObject = JsonConvert.DeserializeObject<JObject>(jsonString);

      if (restoredObject != null)
      { 
        string Is_Valid = restoredObject["Is_Valid"].ToString();
        string msg = restoredObject["Msg"].ToString();

        if (Is_Valid == "Y")
        {
          this.FormView1.DataSource = new List<dynamic>() { restoredObject };
          this.FormView1.DataBind();

          //用來識別為開啟明細新視窗：IsDialog為"1"          
          if (IsDialog == "1")
          {
            FormView1.FindControl("addCart").Visible = false;
            FormView1.FindControl("addWish").Visible = false;
            FormView1.FindControl("tr_Spec").Visible = false;
            FormView1.FindControl("tr_Storage_Qty").Visible = false;
            FormView1.FindControl("tr_Follow").Visible = false;
            FormView1.FindControl("tr_Qty").Visible = false;
            breadcrumbs.Visible = false;
            //SiteMapControl.Visible = false;
          }

          //紀錄此商品屬於何種館別
          //0:一般
          //1:哩上加禮
          //2:紅配綠
          //3:限時折扣(整點特賣)
          //4:期間限定
          dynamic b2ccodeary = restoredObject["B2C_CODE_ary"];
          string Output_Prod_Cat_ID = b2ccodeary[0].Output_Prod_Cat_ID;
          HF_ProdCatID.Value = b2ccodeary[0].Output_Prod_Cat_ID;

          //設定商品名稱
          Page.Title = b2ccodeary[0].B2C_CODE_NAME;
          //商品位在何館別
          string Prod_Cat_ID = b2ccodeary[0].Prod_Cat_ID;
          //動態顯示Banner
          CommonUtil.GetBannerForProduct(Output_Prod_Cat_ID, Prod_Cat_ID, ImgBanner);
          //動態顯示產品明細之SiteMap
          SiteMapControl.B2C_CODE = b2ccodeary[0].B2C_CODE;
          SiteMapControl.B2C_CODE_NAME = b2ccodeary[0].B2C_CODE_NAME;
          SiteMapControl.Prod_Cat_ID = b2ccodeary[0].Prod_Cat_ID;

          //限制生日禮金顯示訊息
          string is_BirthLMT = restoredObject["is_BirthLMT"].ToString();
          if (is_BirthLMT == "Y")
          {
            (FormView1.FindControl("tr_Is_BirthLMT") as HtmlTableRow).Visible = true;
          }

          dynamic dynType = restoredObject["Prd_Type_Ary"];
          //隱藏一般館別商品規格(jQuery會用到，所以使用CSS)
          if (string.IsNullOrEmpty(dynType[0].Prd_Type.ToString()))
          {
            (FormView1.FindControl("tr_Spec") as HtmlTableRow).Attributes.Add("style", "display:none");
          }

          dynamic dynPrice = restoredObject["Prd_PRICE_Ary"];
          //隱藏一般館別商品原價
          if (string.IsNullOrEmpty(dynPrice[0].PROPOSE_PRICE.ToString()) || dynPrice[0].PROPOSE_PRICE.ToString() == "0")
          {
            (FormView1.FindControl("tr_PROPOSE_PRICE") as HtmlTableRow).Visible = false;
          }
          //隱藏一般館別商品會員價
          if (string.IsNullOrEmpty(dynPrice[0].MbrPrice.ToString()) || dynPrice[0].MbrPrice.ToString() == "0")
          {
            (FormView1.FindControl("tr_MbrPrice") as HtmlTableRow).Visible = false;
          }
          //若沒有Promotion，隱藏優惠資訊
          if (restoredObject["B2C_Promotion_Master_Ary"]!=null)
          {
            if (restoredObject["B2C_Promotion_Master_Ary"].Count() == 0)
            {
              (FormView1.FindControl("tr_Promotion") as HtmlTableRow).Visible = false;
            }            
          }
          else
          {
            (FormView1.FindControl("tr_Promotion") as HtmlTableRow).Visible = false;
          }          

          //整合哩上加哩
          if (Output_Prod_Cat_ID == "1")
          {
            (FormView1.FindControl("tr_PROPOSE_PRICE") as HtmlTableRow).Visible = false;
            (FormView1.FindControl("tr_ACT_PRICE") as HtmlTableRow).Visible = false;
            (FormView1.FindControl("tr_MbrPrice") as HtmlTableRow).Visible = false;
            (FormView1.FindControl("tr_Mileages_Price") as HtmlTableRow).Visible = true;
            (FormView1.FindControl("tr_Mileages_MbrPrice") as HtmlTableRow).Visible = true;
            if (!string.IsNullOrEmpty(HttpContext.Current.User.Identity.Name))
            {
              if (HttpContext.Current.Request.Cookies["LoginInfo"] != null)
              {
                HttpCookie LoginInfo = HttpContext.Current.Request.Cookies["LoginInfo"] as HttpCookie;
                string AuthType = LoginInfo.Values["AuthType"].ToString();
                if (AuthType == "1")
                {
                  //(FormView1.FindControl("tr_Mileages_MbrPrice") as HtmlTableRow).Attributes.Remove("disabled");
                  //radio_mileage
                  (FormView1.FindControl("mix_radio_mileage") as HtmlInputRadioButton).Attributes.Remove("disabled");
                }
              }
            }
          }
          else if (Output_Prod_Cat_ID == "3") //限時折扣
          {
            //隱藏原價欄位不顯示
            (FormView1.FindControl("tr_PROPOSE_PRICE") as HtmlTableRow).Visible = false;
            if (dynPrice[0].TimeDscPrice != null && dynPrice[0].TimeDscPrice != "0")
            {
              (FormView1.FindControl("tr_TimeDscPrice") as HtmlTableRow).Visible = true;
            }
          }
          else if (Output_Prod_Cat_ID == "4") //期間限定
          {
            if (dynPrice[0].RangeDscPrice != null && dynPrice[0].RangeDscPrice != "0")
            {
              (FormView1.FindControl("tr_RangeDscPrice") as HtmlTableRow).Visible = true;                            
            }            
            //隱藏原價欄位不顯示
            (FormView1.FindControl("tr_PROPOSE_PRICE") as HtmlTableRow).Visible = false;
            //隱藏特價欄位不顯示
            (FormView1.FindControl("tr_ACT_PRICE") as HtmlTableRow).Visible = false;
          }

          //當商品是哩上加哩時
          if (Output_Prod_Cat_ID == "1")
          {
            DropDownList ddlMileageSpec = FormView1.FindControl("ddlCASHMILEAGE") as DropDownList;
            if (ddlMileageSpec != null)
            {
              ddlMileageSpec.Items.Clear();
              foreach (var ja in (JArray)restoredObject["Prd_PRICE_Ary"])
              {
                //哩上加哩規格
                ListItem li =
                  new ListItem(string.Format("{0:$ #,##0}", ja["CASH"]) + " + "
                    + string.Format("{0:#,##0}", ja["MILEAGE"]) + " 哩"
                    + "(" + CommonUtil.GetEVACardType(ja["FFP_CARD_TYPE"].ToString()) + ")",
                    ja["FFP_CARD_TYPE"].ToString());
                ddlMileageSpec.Items.Add(li);
              }
            }
          }

          //檢核庫存量為0時(當單一規格庫存為0時，則隱藏)
          if (dynType.Count == 1
            && !string.IsNullOrEmpty((string)dynType[0].Storage_Qty) 
            && dynType[0].Storage_Qty == "0")
          {
            (FormView1.FindControl("tr_Storage_Qty") as HtmlTableRow).Visible = true;
            (FormView1.FindControl("tr_Follow") as HtmlTableRow).Visible = true;
            (FormView1.FindControl("txtboxQty") as TextBox).Enabled = false;
            (FormView1.FindControl("addCart") as HtmlAnchor).Visible = false;
            (FormView1.FindControl("tr_Promotion") as HtmlTableRow).Visible = false;
            (FormView1.FindControl("tr_TimeDscPrice") as HtmlTableRow).Visible = false;
            (FormView1.FindControl("tr_RangeDscPrice") as HtmlTableRow).Visible = false;
          }
         
          //if (!string.IsNullOrEmpty((string)dynType[0].Storage_Qty) && dynType[0].Storage_Qty == "0")
          //{
          //  (FormView1.FindControl("tr_Storage_Qty") as HtmlTableRow).Visible = true;
          //  (FormView1.FindControl("tr_Follow") as HtmlTableRow).Visible = true;
          //  (FormView1.FindControl("txtboxQty") as TextBox).Enabled = false;
          //  (FormView1.FindControl("addCart") as HtmlAnchor).Visible = false;
          //  (FormView1.FindControl("tr_Promotion") as HtmlTableRow).Visible = false;
          //  (FormView1.FindControl("tr_TimeDscPrice") as HtmlTableRow).Visible = false;
          //  (FormView1.FindControl("tr_RangeDscPrice") as HtmlTableRow).Visible = false;
          //}
        }
      }
    }
  }

  protected void FormView1_DataBound(object sender, EventArgs e)
  {
    //產品圖片
    PlaceHolder ph1 = this.FormView1.FindControl("PlaceHolder1") as PlaceHolder;
    PlaceHolder ph2 = this.FormView1.FindControl("PlaceHolder2") as PlaceHolder;
    JToken imgArray = restoredObject["IMAGE_PATH_M_Ary"];

    GenImageControl(ph1, imgArray);
    GenImageControl(ph2, imgArray);

    //產品規格SMAS_CODE載入規則
    DropDownList dl = this.FormView1.FindControl("ddlSpec") as DropDownList;
    dynamic Prd_Type_Ary = restoredObject["Prd_Type_Ary"];
    //當SMAS_COED只有一個時，無論是否有庫存一律載入
    if (restoredObject["Prd_Type_Ary"].Count() == 1)
    {
      dl.DataSource = restoredObject["Prd_Type_Ary"];
      dl.DataTextField = "Prd_Type";
      dl.DataValueField = "Smas_Code";
      dl.DataBind();
    }
    else
    {
      //取出庫存不為0的SMAS_CODE
      var Prd_Type_Ary_Qty = restoredObject["Prd_Type_Ary"]
        .Where(p => p["Storage_Qty"].ToString() != "0");
      //假設全部的SMAS_CODE庫存都為0，則載入第一筆資料，否則載入篩選後的資料
      if (Prd_Type_Ary_Qty.Count() != 0)
      {
        dl.DataSource = Prd_Type_Ary_Qty;
        dl.DataTextField = "Prd_Type";
        dl.DataValueField = "Smas_Code";
        dl.DataBind();
      }
      else
      {
        dl.Items.Add(new ListItem((string)Prd_Type_Ary[0].Prd_Type, (string)Prd_Type_Ary[0].Smas_Code));
        (FormView1.FindControl("tr_Spec") as HtmlTableRow).Attributes.Add("style", "display:none");     
      }
    }    

    //優惠特價    
    JArray PromotionArray = restoredObject["B2C_Promotion_Master_Ary"] as JArray;
    Panel Panel_Promotion = this.FormView1.FindControl("Panel_Promotion") as Panel;
    if (PromotionArray!=null)
    {
      foreach (var PA in PromotionArray)
      {
        string promotion = PA["B2C_Pro_Name"].ToString();
        LiteralControl lc = new LiteralControl("<ol><li><img src='../Images/Icons/RightArrow.png'> " + promotion + "</li></ol>");
        Panel_Promotion.Controls.Add(lc);
      }      
    }
    
  }

  private static void GenImageControl(PlaceHolder ph, JToken imgArray)
  {
    int getImageCount = ((JArray)(imgArray)).Count;
    int genimageCount = getImageCount < 3 ? getImageCount : 3;
    for (int i = 0; i < genimageCount; i++)
    {
      Image img = new Image();
      img.ImageUrl = imgArray[i]["IMAGE_PATH_M"].ToString();
      ph.Controls.Add(img);
    }
  }
</script>

<script type="text/javascript">
  //$(document).ready(function () {
    //load
    //var smas_code = $("[id*='ddlSpec']").val();
    //DisplayProductDetailInfo(smas_code);

    //change
    //$("[id*='ddlSpec']").on('change', function () {
    //  smas_code = this.value; // or $(this).val()
    //  DisplayProductDetailInfo(smas_code);
    //});
  //});

  function DisplayProductDetailInfo(smas_code) {
    $.ajax({
      type: "POST",
      url: "<%= Page.ResolveUrl("~/Shopping/AddToCart.aspx/GetStorageQtyBySmasCode")%>",
      data: "{'smas_code': '" + smas_code + "'}",
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function (data, status) {
        if (data.d != '0') {
          $("[id*=tr_Storage_Qty]").attr("visibility", "visible");          
          $("[id*=tr_Follow]").attr("visibility", "visible");
          $("[id*=txtboxQty]").hide();
          $("[id*=addCart]").hide();                    
        }
      },
      error: function (xhr, ajaxOptions, thrownError) {
        //alert("ERROR : " + JSON.stringify(xhr));
      }
    });
  }
</script>

<div class="breadcrumbs" id="breadcrumbs" runat="server">
  <Page:SiteMap runat="server" ID="SiteMapControl" />
</div>
<div id="ProductDetail" class="myDivToPrint">
  <asp:FormView ID="FormView1" runat="server" OnDataBound="FormView1_DataBound" BackColor="White">
    <ItemTemplate>
      <div class="product">
        <%--<div class="breadcrumbs">
          <Page:SiteMap runat="server" ID="SiteMapControl" />
        </div>--%>
        <div class="product-left">
          <div class="product-item JS_indexSlider">
            <div class="slide-obj">
              <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
            </div>
            <div class="release">
              <%# CommonUtil.GetNEWAndHOT(((dynamic)Eval("B2C_CODE_ary"))[0].light_status.ToString()) %>
            </div>
            <div class="slide-control">
              <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder>
            </div>
          </div>
        </div>
        <div class="product-right">
          <div class="share-tools">
            <!-- Social Button BEGIN -->
            <div class="social-network">
              <a href="javascript: void(window.open('http://www.facebook.com/share.php?u='.concat(encodeURIComponent(location.href)) ));" class="button_facebook" title="分享到facebook"></a>
              <a href="javascript: void(window.open('http://twitter.com/share?url='.concat(encodeURIComponent(location.href)) .concat('&text=') .concat(encodeURIComponent(document.title))));" class="button_twitter" title="分享到twitter"></a>
              <a href="javascript: void(window.open('http://www.plurk.com/?qualifier=shares&amp;status=' .concat(encodeURIComponent(location.href)) .concat(' ') .concat('(') .concat(encodeURIComponent(document.title)) .concat(')')));" class="button_plurk" title="分享到plurk"></a>
              <a href="javascript: void(window.open('http://v.t.sina.com.cn/share/share.php?title='.concat(encodeURIComponent(document.title)).concat('&url=').concat(encodeURIComponent(location.href))));" class="button_sinaweibo" title="分享到新浪微博"></a>
              <div class="mail-print">
                <a href="javascript:window.print();" class="button_print"></a>
                <a href="#" class="button_mail JS-AddFollow"></a>
              </div>
            </div>

          </div>
          <div class="product-info">
            <h4><%# ((dynamic)Eval("B2C_CODE_ary"))[0].B2C_CODE_NAME %></h4>
            <table>
              <tr>
                <th>商品代碼</th>
                <td>
                  <asp:Label ID="lbl_B2C_CODE" runat="server"
                    Text='<%# ((dynamic)Eval("B2C_CODE_ary"))[0].B2C_CODE %>' />
                </td>
              </tr>
              <tr id="tr_PROPOSE_PRICE" runat="server">
                <th>原價</th>
                <td>$
                  <asp:Label ID="lbl_PROPOSE_PRICE" runat="server"
                    Text='<%# ((dynamic)Eval("Prd_PRICE_Ary"))[0].PROPOSE_PRICE.ToString("n0") %>' />
                </td>
              </tr>
              <tr id="tr_ACT_PRICE" runat="server">
                <th>特價</th>
                <td>
                  <strong>$
                    <asp:Label ID="lbl_ACT_PRICE" runat="server"
                      Text='<%# ((dynamic)Eval("Prd_PRICE_Ary"))[0].ACT_PRICE.ToString("n0") %>' />
                  </strong>
                </td>
              </tr>
              <tr class="orange-text" id="tr_MbrPrice" runat="server">
                <th>會員獨享價</th>
                <td><strong>$
                  <asp:Label ID="lbl_MbrPrice" runat="server"
                    Text='<%# ((dynamic)Eval("Prd_PRICE_Ary"))[0].MbrPrice.ToString("n0") %>' />
                </strong></td>
              </tr>
              <tr class="orange-text" id="tr_Mileages_Price" runat="server" visible="false">
                <th>
                  <input type="radio" name="mileage" id="act_radio_mileage" runat="server"
                    value="1" checked />
                  特價</th>
                <td><strong>$
                  <asp:Label ID="lbl_Mileages_Price" runat="server"
                    Text='<%# ((dynamic)Eval("Prd_PRICE_Ary"))[0].ACT_PRICE.ToString("n0") %>' /></strong></td>
              </tr>
              <tr class="orange-text" id="tr_Mileages_MbrPrice" runat="server" visible="false">
                <th>
                  <input type="radio" name="mileage" id="mix_radio_mileage" runat="server" value="2" disabled="disabled" />
                  現金+哩程</th>
                <td>
                  <asp:DropDownList ID="ddlCASHMILEAGE" runat="server"></asp:DropDownList>
                </td>
              </tr>
              <tr class="orange-text" id="tr_TimeDscPrice" runat="server" visible="false">
                <th>限時優惠價</th>
                <td><strong>$
                  <asp:Label ID="lbl_TimeDscPrice" runat="server"
                    Text='<%# ((dynamic)Eval("Prd_PRICE_Ary"))[0].TimeDscPrice.ToString("n0") %>' />
                </strong></td>
              </tr>
              <tr class="orange-text" id="tr_RangeDscPrice" runat="server" visible="false">
                <th>期間限定價</th>
                <td><strong>$
                  <asp:Label ID="lbl_RangeDscPrice" runat="server"
                    Text='<%# ((dynamic)Eval("Prd_PRICE_Ary"))[0].RangeDscPrice.ToString("n0") %>' />
                </strong></td>
              </tr>              
              <tr class="dotted">
                <th></th>
                <td></td>
              </tr>
              <tr id="tr_Qty" runat="server">
                <th>數量</th>
                <td>
                  <asp:TextBox ID="txtboxQty" runat="server" Text="1" MaxLength="3"></asp:TextBox>
                  <asp:RequiredFieldValidator ID="RVQty1" runat="server" ErrorMessage="*" ControlToValidate="txtboxQty" ForeColor="Red" Display="Dynamic" SetFocusOnError="true" />
                  <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ControlToValidate="txtboxQty" ForeColor="Red" Display="Dynamic" InitialValue="0" SetFocusOnError="true" />
                </td>
              </tr>
              <tr class="padded" id="tr_Spec" runat="server">
                <th>規格</th>
                <td>                  
                  <asp:DropDownList CssClass="short" ID="ddlSpec" runat="server"></asp:DropDownList>
                </td>
              </tr>
              <tr class="padded" id="tr_Is_BirthLMT" runat="server" visible="false">
                <th></th>
                <td>                  
                  <p class="red-text">此商品不適用生日禮金</p>
                </td>
              </tr>
              <tr class="padded" id="tr_Promotion" runat="server">
                <th>優惠資訊</th>
                <td>
                  <asp:Panel ID="Panel_Promotion" runat="server" ScrollBars="Auto" Height="130" />
                </td>
              </tr>
              <tr id="tr_Storage_Qty" runat="server" visible="false">
                <td>
                  <p class="red-text">商品補貨中!</p>
                </td>
              </tr>
              <tr id="tr_Follow" runat="server" visible="false">
                <td>
                  <a href="#" class="red-arrow JS-AddSave">加入追蹤</a>
                </td>
              </tr>
            </table>
          </div>
          <div class="product-btn">
            <%--<asp:LinkButton ID="addCart" class="blue-btn " runat="server" AlternateText="加入購物車">
                <img id="ImgAddCar" src="~/Images/Icons/Car.png" runat="server" title="加入購物車" />
                加入購物車
              </asp:LinkButton>--%>
            <a class="blue-btn JS-addCart" id="addCart" runat="server" title="加入購物車">
              <img id="Img7" src="~/Images/Icons/Car.png" runat="server" title="加入購物車" />
              加入購物車</a>
            <a class="blue-btn JS-addWish" id="addWish" runat="server" title="加入預選清單">
              <img id="Img1" src="~/Images/Icons/WishList.png" runat="server" title="加入預選清單" />
              加入預選清單</a>
            <%--<asp:LinkButton ID="addWish" class="blue-btn" runat="server" AlternateText="加入預選清單"
              PostBackUrl="~/Shopping/Wishlist.aspx">
              <img id="Img8" src="~/Images/Icons/WishList.png" runat="server" title="加入預選清單" />
              加入預選清單
            </asp:LinkButton>--%>
          </div>
        </div>
      </div>
      <div class="product-spec">
        <div class="tab-bar JS-tabs">
          <ul>
            <li>
              <a class="active" href="#">商品資訊</a>
            </li>
            <li>
              <a href="#">商品規格</a>
            </li>
            <li>
              <a href="#">商品運送&保證</a>
            </li>
            <li>
              <a href="#">其他說明</a>
            </li>
          </ul>
        </div>
        <div class="tab-areas">
          <div class="tab-content">
            <%#  Server.HtmlDecode(((dynamic)Eval("Prd_Info_HTML")).ToString()) %>
          </div>
          <div class="tab-content">
            <%#  Server.HtmlDecode(((dynamic)Eval("Prd_SPEC_HTML")).ToString()) %>
          </div>
          <div class="tab-content">
            <%#  Server.HtmlDecode(((dynamic)Eval("Prd_Trans_HTML")).ToString()) %>
            <%#  Server.HtmlDecode(((dynamic)Eval("Prd_Gurt_HTML")).ToString()) %>
          </div>
          <div class="tab-content">
            <%#  Server.HtmlDecode(((dynamic)Eval("Prd_Memo_HTML")).ToString()) %>
          </div>
        </div>
      </div>
    </ItemTemplate>
  </asp:FormView>
  <asp:HiddenField ID="HF_ProdCatID" runat="server" />
  <div style="display: none" class="popup-content">
    <!-- Email Start -->
    <div class="save-email">
      <h4>目前因此項商品補貨中，請填寫您的E-Mail，貨到時我們會以Mail通知您。</h4>
      <div class="email-container">
        Email<input type="text" name="email-save" id="email-save" value="" />
      </div>
      <div class="liner"></div>
      <div class="links">
        <h4>
          <asp:Label ID="lbl_save_message" CssClass="email-message" runat="server"
            ForeColor="Red" EnableViewState="false" /></h4>
        <a href="#" class="btn" id="email-save-confirm" onclick="SaveProductToMail();">確定</a>
      </div>
    </div>

    <div class="follow-email">
      <h4>請填寫您的E-Mail，我們會將您感興趣的商品資訊以Mail傳送給您。</h4>
      <div class="email-container">
        Email<input type="text" name="email-follow" id="email-follow" value="" />
      </div>
      <div class="liner"></div>
      <div class="links">
        <h4>
          <asp:Label ID="lbl_follow_message" CssClass="email-message" runat="server"
            ForeColor="Red" EnableViewState="false" /></h4>
        <a href="#" class="btn" id="email-follow-confirm" onclick="SendProductToMail();">確定</a>
      </div>
    </div>
    <!-- #Email End -->
    <!-- Message type 1 -->
    <div class="message-finish">
      <div class="notice">
        <h4><span id="spanMsg"/></h4>
      </div>
    </div>
    <!-- #Message type 1 End -->     
  </div>
</div>
